<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript" src="http://keniu100.cn/static/js/jquery-3.2.1.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js"></script>
    <link rel="stylesheet" href="http://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css">
</head>
<body>
    <p class="act_time">
        活动时间:
        <input type="text" id="StartDate" value="2018-11-06 16:02" readonly=""> 到
        <input id="EndDate" type="text" value="2018-11-13 16:02" readonly="">
        <br>
        <span>建议持续时间5-7天</span>
    </p>
    <script>
        $(function() {
            $("#StartDate").datetimePicker();
            $("#EndDate").datetimePicker();
        });
        $(function() {
            var date=new Date();
            console.log(date)
            var year=date.getFullYear();
            var month = date.getMonth()+1;
            var mydate = date.getDate();
            var hour = date.getHours();
            var minute = date.getMinutes();
            month=month<10?'0'+month:month;
            mydate=mydate<10?'0'+mydate:mydate;
            hour=hour<10?'0'+hour:hour;
            minute=minute<10?'0'+minute:minute;
            console.log(year);
            console.log(month);
            console.log(mydate);
            console.log(hour);
            console.log(minute);
            var time = year+'-'+month+'-'+mydate+' '+hour+':'+minute;
            $('#StartDate').val(time);
        });
    </script>
</body>
</html>